package com.gold.wechat.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gold.wechat.dao.WechatLoginDao;
import com.gold.wechat.entity.WechatLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author XiaoHao
 * @date 2022-06-02 16:56
 */
@Service
public class WechatLoginService {
    @Autowired
    WechatLoginDao wechatLoginDao;

    public void insert(WechatLogin wechatLogin){
        wechatLoginDao.insert(wechatLogin);
    }

    public WechatLogin selectOne(String wxId){
        QueryWrapper<WechatLogin> qw = new QueryWrapper<>();
        qw.eq("wxId",wxId);
        return wechatLoginDao.selectOne(qw);
    }

    public void update(WechatLogin wechatLogin){
        wechatLoginDao.updateById(wechatLogin);
    }
}
